﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Zyg.SSO.Core.Business
{
    public class SysSetting : BusinessBase<SysSetting, Guid>
    {
        #region Fields and Properties

        private bool registerCheck;
        private int pageSize;
        private string copyright = String.Empty;

        public bool RegisterCheck
        {
            get { return registerCheck; }
            set { if (registerCheck != value) { registerCheck = value; } MarkChanged("RegisterCheck"); }
        }

        public int PageSize
        {
            get { return pageSize; }
            set { if (pageSize != value) { pageSize = value; } MarkChanged("PageSize"); }
        }

        public string Copyright
        {
            get { return copyright; }
            set { if (copyright != value) { copyright = value; } MarkChanged("PageSize"); }
        }

        #endregion

        #region Base Overrides

        protected override void ValidationRules()
        {
        }

        protected override SysSetting DataSelect(Guid id)
        {
            return Services.DALService.SelectCurrentSysSetting();
        }

        protected override void DataUpdate()
        {
        }

        protected override void DataInsert()
        {
            Services.DALService.InsertSysSetting(this);
        }

        protected override void DataDelete()
        {
        }

        #endregion

        #region Static Methods

        public static SysSetting GetCurrent()
        {
            return Services.DALService.SelectCurrentSysSetting();
        }

        #endregion
    }
}
